//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package project_dao

import "go.mongodb.org/mongo-driver/mongo"

var ProjectInfoDao *_ProjectInfoDao
var MemberInfoDao *_MemberInfoDao
var MemberRoleDao *_MemberRoleDao
var MemberStateDao *_MemberStateDao
var ProjectCounterDao *_ProjectCounterDao
var ProjectInviteDao *_ProjectInviteDao
var LocalPermDao *_LocalPermDao
var TagInfoDao *_TagInfoDao
var RecycleDao *_RecycleDao
var AckJoinDao *_AckJoinDao
var GitRepoDao *_GitRepoDao
var ServerDao *_ServerDao

func InitDao(mgoDb *mongo.Database) (err error) {
	ProjectInfoDao, err = newProjectInfoDao(mgoDb)
	if err != nil {
		return
	}
	MemberInfoDao, err = newMemberInfoDao(mgoDb)
	if err != nil {
		return
	}
	MemberRoleDao, err = newMemberRoleDao(mgoDb)
	if err != nil {
		return
	}
	MemberStateDao, err = newMemberStateDao(mgoDb)
	if err != nil {
		return
	}
	ProjectCounterDao, err = newProjectCounterDao(mgoDb)
	if err != nil {
		return
	}
	ProjectInviteDao, err = newProjectInviteDao(mgoDb)
	if err != nil {
		return
	}
	LocalPermDao, err = newLocalPermDao(mgoDb)
	if err != nil {
		return
	}
	TagInfoDao, err = newTagInfoDao(mgoDb)
	if err != nil {
		return
	}
	RecycleDao, err = newRecycleDao(mgoDb)
	if err != nil {
		return
	}
	AckJoinDao, err = newAckJoinDao(mgoDb)
	if err != nil {
		return
	}
	GitRepoDao, err = newGitRepoDao(mgoDb)
	if err != nil {
		return
	}
	ServerDao, err = newServerDao(mgoDb)
	if err != nil {
		return
	}
	return
}
